package com.frogs.ucenter.v1.request;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.util.IdentityTypeEnum;
import com.frogs.system.web.api.request.Request;

public class FollowedBaseInfoMergeRequest extends Request {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7642698696289500406L;

	private int sex = 0;
	private Date birthday;
	private int height = 0;
	private int weight = 0;
	private int age = 0;
	private int id;
	private String diseaseTags;
	private String userId;
	private String phone;
	private String relatives;
	private String realName;
	private int identityType;
	private String identityCard;
	
	public int getSex() {
		return sex;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getWeight() {
		return weight;
	}

	public void setWeight(int weight) {
		this.weight = weight;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getDiseaseTags() {
		return diseaseTags;
	}

	public void setDiseaseTags(String diseaseTags) {
		this.diseaseTags = diseaseTags;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getRelatives() {
		return relatives;
	}

	public void setRelatives(String relatives) {
		this.relatives = relatives;
	}
	
	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public int getIdentityType() {
		return identityType;
	}

	public void setIdentityType(int identityType) {
		this.identityType = identityType;
	}

	public String getIdentityCard() {
		return identityCard;
	}

	public void setIdentityCard(String identityCard) {
		this.identityCard = identityCard;
	}

	@Override
	public void parse(HttpServletRequest request) {
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		this.id = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), -1);
		
		this.birthday = requestInfo.getDateParameter(ApiUrlParamEnum.birthday.getParamName(), "yyyy-MM-dd");
		
		this.sex = requestInfo.getIntParameter(ApiUrlParamEnum.sex.getParamName(),-1);
		
		this.height = requestInfo.getIntParameter(ApiUrlParamEnum.height.getParamName(), -1);
		
		this.weight = requestInfo.getIntParameter(ApiUrlParamEnum.weight.getParamName(), -1);
		
		this.age = requestInfo.getIntParameter(ApiUrlParamEnum.age.getParamName(), 0);
		
		this.diseaseTags = requestInfo.getParameter(ApiUrlParamEnum.diseaseTag.getParamName(), "");
		
		this.userId = requestInfo.getParameter(ApiUrlParamEnum.tempUserId.getParamName(), "");
		
		this.phone = requestInfo.getParameter(ApiUrlParamEnum.phone.getParamName(), "");
		
		this.relatives = requestInfo.getParameter(ApiUrlParamEnum.relatives.getParamName(), "");
		
		this.realName = requestInfo.getParameter(ApiUrlParamEnum.realName.getParamName(), "");
		
		this.identityCard = requestInfo.getParameter(ApiUrlParamEnum.identityCard.getParamName());
		
		this.identityType = requestInfo.getIntParameter(ApiUrlParamEnum.identityType.getParamName(), IdentityTypeEnum.IDCARD.getId());
	}

}
